<?php
namespace app\common\model\activity;


use app\common\model\BaseModel;
use app\common\model\store\product\Product;
use app\common\model\system\merchant\Merchant;

class NewActivityProduct extends BaseModel
{

    /**
     * @return string
     * @author: fupeng
     * @day: 2024/1/28
     */
    public static function tablePk(): string
    {
        return 'new_activity_product_id';
    }

    /**
     * @return string
     * @author: fupeng
     * @day: 2024/1/28
     */
    public static function tableName(): string
    {
        return 'store_new_activity_product';
    }

    public function product()
    {
        return $this->hasOne(Product::class,'product_id','product_id');
    }

    public function newActivity()
    {
        return$this->hasMany(NewActivity::class,'new_activity_id','new_activity_id');
    }

    public function merchant()
    {
        return $this->hasOne(Merchant::class,'mer_id','mer_id');
    }
}
